<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;

class Folder extends Base
{
    use SoftDeletes;

    /**
     * 文案（一对多关系）
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function pappers() {
        return $this->hasMany(Papper::class);
    }
    
    /**
     * 视频素材（一对多关系）
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function videos() {
        return $this->hasMany(Video::class);
    }
    
    /**
     * 分类（一对一关系）
     * @return \Illuminate\Database\Eloquent\Relations\belongsTo
     */
    public function label() {
        return $this->belongsTo(FolderLabel::class);
    }
    
    /**
     * 素材包（一对多关系）
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function packs() {
        return $this->hasMany(Pack::class);
    }
    
    public function user() {
        return $this->belongsTo(User::class);
    }
}
